<html>
<head>
    <meta name="layout" content="freshmade">
</head>

<body>

<div id="content-wrapper">
    <div class="center-wrapper">
        <div class="content">
            <div id="main">
                <div class="post">
                    <div class="post-title">
                        <h1>File List</h1>
                        <g:render template="/template/messageBar"/>
                    </div>

                    <div class="post-date">
                        <g:render template="/template/listBar3" model="[size: files.size()]"/>
                        | NumOfFiles: ${numOfFiles}
                    </div>
                </div>

                <table class="data-table">
                    <tr>
                        <th>Name</th>
                        <th>Date</th>
                        <th>Uri</th>
                        <th><g:message code="trace.createdBy"/></th>
                        <th><g:message code="trace.dateCreated"/></th>
                        <th>Delete</th>
                    </tr>
                    <tbody>
                    <g:each in="${files}" status="i" var="f">
                        <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
                            <td><g:link controller="sample" action="index" id="${f.id}">
                                ${f.name}
                            </g:link></td>
                            <td>${f.dateCreated}</td>
                            <td><g:link uri="${f.uri}">${f.uri}</g:link></td>
                            <td>${f.createdBy.name}</td>
                            <td><g:formatDate date="${f.dateCreated}"/></td>
                            <td><g:link action="delete" id="${f.id}"
                                        onclick="return confirm('${message(code: 'default.delete.confirm')}');">
                                Delete</g:link></td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>

            <div class="clearer">&nbsp;</div>
        </div>

    </div>
</div>

</body>
</html>
